package com.model;

// Generated 15 f�vr. 2013 15:56:26 by Hibernate Tools 4.0.0

import java.util.Date;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Droit generated by hbm2java
 */
@Entity
@Table(name = "Droit", schema = "dbo", catalog = "CRM")
public class Droit implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private DroitId id;
	private Employe employe;
	private Fichier fichier;
	private DroitType droitType;
	private Date dateCreation;

	public Droit() {
	}

	public Droit(DroitId id, Employe employe, Fichier fichier,
			DroitType droitType) {
		this.id = id;
		this.employe = employe;
		this.fichier = fichier;
		this.droitType = droitType;
	}

	public Droit(DroitId id, Employe employe, Fichier fichier,
			DroitType droitType, Date dateCreation) {
		this.id = id;
		this.employe = employe;
		this.fichier = fichier;
		this.droitType = droitType;
		this.dateCreation = dateCreation;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "fichierId", column = @Column(name = "fichierId", nullable = false)),
			@AttributeOverride(name = "droitTypeId", column = @Column(name = "DroitTypeId", nullable = false)),
			@AttributeOverride(name = "employeId", column = @Column(name = "employeId", nullable = false)) })
	public DroitId getId() {
		return this.id;
	}

	public void setId(DroitId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "employeId", nullable = false, insertable = false, updatable = false)
	public Employe getEmploye() {
		return this.employe;
	}

	public void setEmploye(Employe employe) {
		this.employe = employe;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "fichierId", nullable = false, insertable = false, updatable = false)
	public Fichier getFichier() {
		return this.fichier;
	}

	public void setFichier(Fichier fichier) {
		this.fichier = fichier;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "DroitTypeId", nullable = false, insertable = false, updatable = false)
	public DroitType getDroitType() {
		return this.droitType;
	}

	public void setDroitType(DroitType droitType) {
		this.droitType = droitType;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "dateCreation", length = 23)
	public Date getDateCreation() {
		return this.dateCreation;
	}

	public void setDateCreation(Date dateCreation) {
		this.dateCreation = dateCreation;
	}

}
